﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>熔炼车间投料 - 列表页面</title>
    <link rel="stylesheet" href="../../css/base.css" />
    <link rel="stylesheet" href="../../css/index.css" />
    <style type="text/css">
        html, body {
            background: #fff;
        }

    </style>
</head>
<body>
    <div class="header" style="z-index:2">
        熔炼车间投料记录
    </div>
    <div class="list" style="overflow: auto;width:330px; height:440px; z-index:1">
        <table cellspacing="0" cellpadding="0" border="0">
            <thead>
                <tr>
                    <th>时间</th>
                    <th>投料口编号</th>
                    <th>投料操作工</th>
                    <th>铝锭编号（材料牌号）</th>
                    <th>标准桶（材料牌号）</th>
                </tr>
            </thead>
            <tbody id="tbody"></tbody>
</table>
    </div>

    <script type="text/plain" id="texts">
        <tr onclick="selectCont(this);">
            <td><div class="ikd_cbConl FDate">_FDate_</div></td>
            <td><div class="ikd_cbConl FTLKNumber">_FTLKNumber_</div></td>
            <td><div class="ikd_cbConl FTLYGNnmber">_FTLYGNnmber_</div></td>
            <td><div class="ikd_cbConl FNumber">_FNumber_</div></td>
            <td><div class="ikd_cbConl FTongNumber">_FTongNumber_</div></td>
        </tr>
    </script>

    <script src="../../script/base/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../script/layer/layer.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../script/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../script/base/H.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../script/DbHelper.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        var page = 1;
        var state = true;
        apiready = function () {
            data();

            api.addEventListener({
                name: 'scrolltobottom',
                extra: {
                    threshold: 0           //设置距离底部多少距离时触发，默认值为0，数字类型
                }
            }, function (ret, err) {
                if (state == false) {
                    db.Ts.toast('暂无更多', 2000, 'x'); return;
                }
                page = page + 1;
                data();
                // 加载下一页的数据，然后向现有页面追加数据。
            });
        }

        //查看信息
        function selectCont(dom) {
            //铝锭(材料牌号)
            var cc1 = $(dom).find(".FNumber").html();
            //标准桶(材料牌号)
            var cc2 = $(dom).find(".FTongNumber").html();
            //layer插件
            layer.open({
                //标题
                title:"<b style='font-size:14px;'>系统信息</b>",
                //内容
                content: "<b>时间：</b><br />" + $(dom).find(".FDate").html() + "<br />"
                + "<b>投料口编号：</b><br />" + $(dom).find(".FTLKNumber").html() + "<br />"
                + "<b>投料工：</b><br />" + $(dom).find(".FTLYGNnmber").html() + "<br />"
                + (cc1 == "" ? "" : "<b>铝锭(材料牌号)：</b><br />" + cc1 + "<br />")
                + (cc2==""?"":"<b>标准桶(材料牌号)：</b><br />" + $(dom).find(".FTongNumber").html() + "<br />")
                ,
                //关闭后执行
                end: function (index, layero) {
                }
            });
        }

        //加载数据
        function data() {
            db.ajax(function (ret, err) {
                var data = eval('(' + ret + ')');
                if (db.Data.JsonGet(data, "status", "") == "200") {
                    //没数据直接结束
                    if (data.msg.ds.length <= 0) {
                        db.Ts.toast('暂无更多', 2000, 'x');
                        state = false;//无数据
                        return;
                    }

                    var texts = $("#texts").html();
                    var htmls = "";
                    for (var i = 0; i < data.msg.ds.length; i++) {
                        //铝锭编号
                        var ld = data.msg.ds[i].FNumber;
                        //称重桶编号
                        var czt = data.msg.ds[i].FTongNumber;
                        var tt = data.msg.ds[i].TongCLPH;
                        var cc = data.msg.ds[i].LDCLPH;
                        //
                        htmls += texts.replace(/_FTLKNumber_/g, '' + data.msg.ds[i].FTLKNumber)
	            		.replace(/_FTLYGNnmber_/g, '' + data.msg.ds[i].FEmplName)
                        .replace(/_FDate_/g, '' + data.msg.ds[i].FDate.substring(0, 10) + " " + data.msg.ds[i].FDate.substring(11, 19))//
	            		.replace(/_FTongNumber_/g, '' + (czt != '' ? '称重桶' + czt : '') + (tt == '' ? '' : '(' + tt + ')'))
	            		.replace(/_FNumber_/g, '' + (ld != '' ? '铝锭' + ld : '') + (cc == '' ? '' : '(' + cc + ')'));
                    }
                    $("#tbody").append(htmls);

                } else {
                    db.Ts.toast('网络异常请稍后重试...', 2000, 'x');
                }
            }, "m_ronglianliest", "post", {
                pageindexInt: 1, BLCompanyID: db.getCurrentUser().quyuId
            }, { title: '读取中', text: '请耐心等待...' });

        }

    </script>
</body>
</html>